
//
//  ImageColorObject.m
//  KamunShangCheng
//
//  Created by Michael Li on 2018/7/26.
//  Copyright © 2018年 Michael Li. All rights reserved.
//

#import "ImageColorHelper.h"

@implementation ImageColorHelper
+(UIImage*)createImageWithColor:(UIColor*)color
{
    CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextFillRect(context, rect);
    UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return theImage;
}
@end
